package org.wendu.wdoa.security.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.wendu.wdoa.security.dto.RoleQueryDto;
import org.wendu.wdoa.security.model.Fun;
import org.wendu.wdoa.security.model.Role;

import java.util.List;

public interface RoleDao {

    List<Role> findRoleList(RoleQueryDto dto);

    @Delete("delete from t_rf where ro_id = #{id}")
    void deleteAllFunsByRoleId(Integer ro_id);

    void insertRoleFuns(
            @Param("roleId") Integer ro_id,
            @Param("funIds") Integer[] funIds
    );

    List<Fun> findRoleFunList(Integer roleId);

}
